package com.example.hasee.intenttest;

import android.content.Intent;
import android.net.Uri;
import android.support.v7.app.AppCompatActivity;
import android.os.Bundle;
import android.view.View;
import android.widget.Button;

public class IntentTest extends AppCompatActivity {
/*Called when the activity is first created.*/
    @Override
    protected void onCreate(Bundle savedInstanceState) {
        super.onCreate(savedInstanceState);
        setContentView(R.layout.activity_intent_test);

        Button dialer=(Button)findViewById(R.id.B1);
        dialer.setOnClickListener(new View.OnClickListener(){
            public void onClick(View v){
                //Intent <Intent_name>=new Intent (<Action>,<Data>);
                Intent intent = new Intent(Intent.ACTION_DIAL, Uri.parse("tel://114"));
                startActivity(intent);
            }
        });
    }
}
